<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>{{component}} test runner</title>
    <link rel="stylesheet" href="/kissy/tools/jasmine/jasmine.css">
    <link rel="stylesheet" href="/kissy/build/css/dpl/base.css"/>

    {{#each externalLinks}}
        <link rel="stylesheet" href="{{{.}}}"/>
    {{/each}}

    <style>
        {{{externalStyle}}}
    </style>

    <script src="/kissy/build/seed.js"></script>
    <script src="/kissy/src/package.js"></script>
    <script src="/kissy/tools/jasmine/jasmine.js"></script>
    <script src="/kissy/tools/jasmine/jasmine-html.js"></script>
    <script src="/kissy/tools/jasmine/jasmine.console_reporter.js"></script>
    <script src="/kissy/tools/jasmine/event-simulate.js"></script>
    {{#each externalScripts}}
        <script src="{{{.}}}"></script>
    {{/each}}
</head>
<body>
<h1 style="text-align: center">{{component}} test cases</h1>
{{{html}}}
<script>
    var tests=['specs/'];

    KISSY.config('packages',{
        specs:{
            base:'../'
        },
        src:{
            base:'/kissy/'
        }
    });

    {{#if tests}}
        tests.shift();
    {{/if}}

    {{#each tests}}
    tests.push('specs/{{{.}}}');
    {{/each}}

    {{{script}}}

    KISSY.use(tests, function (S) {
        jasmine.getEnv().addReporter(new jasmine.TrivialReporter());
        jasmine.getEnv().addReporter(new jasmine.ConsoleReporter());
        jasmine.getEnv().execute(function () {
            jasmine.kissyNext(this.results().failedCount);
        });
    });
</script>
{{{include './footer'}}}
</body>
</html>